if(typeof Ext.user.method.workuserstore == 'undefined'){ Ext.user.method.workuserstore = Ext.user.method.workuser(); }
Ext.user.worktabara = [
	{xtype:'panel',columnWidth: 0.06,items:[{xtype:'panel',style:'margin-left:5px;margin-right:5px;line-height:20px;',html:'选择用户:'},]},
	{xtype:'panel',columnWidth: 0.09,items:[
		{xtype: 'combo',
			width:100,
			name:'id', 
			store: Ext.user.method.workuserstore,
			displayField:'name',
			valueField:'id',
			hiddenName:'name',
			hiddenValue:'id',
			typeAhead: true,
			editable:false,
			forceSelection: true,
			mode:'local',
			triggerAction: 'all',
			emptyText:'请选择',	
			selectOnFocus:true,
			blankText:'不能为空',
			allowBlank:false,
		}
	]},
	{xtype:'panel',style:'margin-left:5px;',columnWidth: 0.04,items:[{xtype:'button',text:'查  找',handler:function(){
		var name = Ext.getCmp('worksearch').form.getValues().name;
		var panel = Ext.getCmp('workpanel');
		panel.removeAll();
		var aa = (Ext.get('workpanel').query('*[class=x-panel-body]'))[0].id;
		panel.add(new Ext.user.CalendarPanelfunc({uid:name}).render(aa));
	}}]},
];
Ext.user.worktabar = {border:true,frame:true,id:'worksearch',xtype:'form',title:'',height:40,layout: 'column',items:Ext.user.worktabara}

Ext.user.CalendarPanelfunc = function(cfg){
	this.cfg = cfg || {};
	this.uid = this.cfg.uid;
	if(this.uid) 
		this.Params = {'do':'id','uid':this.uid};
	else
		this.Params = {};
	this.store = new Ext.data.JsonStore({
        storeId: 'eventStore',
        root: 'list',
		url: Ext.user.baseUrl + '/Work/data/',
		autoLoad: true,
		baseParams:this.Params,
        fields: Ext.ensible.cal.EventRecord.prototype.fields.getRange(),
        idProperty: Ext.ensible.cal.EventMappings.EventId.mapping || 'id'	
	});
	return new Ext.ensible.cal.CalendarPanel({
		autoWidth: true,
		showWeekView:false,
		showDayView:false,
		showMultiWeekView:false,
		height:window.parent.Ext.getCmp('center_89').getHeight()-70,
		id:'haha',
		readOnly:true,
		eventStore: this.store
	});
}
Ext.user.CalendarPanel = Ext.extend(Ext.Panel, {
    title: '值日表',
	renderTo:'work_index',
	id:'workpanel',
	tbar:Ext.user.worktabar,
	initComponent:function(){
		this.items = [new Ext.user.CalendarPanelfunc()];
		Ext.user.CalendarPanel.superclass.initComponent.call(this);
	}
});